package com.atguigu.gulimall.product.vo;

import com.atguigu.gulimall.product.entity.SkuImagesEntity;
import com.atguigu.gulimall.product.entity.SkuInfoEntity;
import com.atguigu.gulimall.product.entity.SpuInfoDescEntity;
import lombok.Data;
import lombok.ToString;

import java.util.List;

@Data
public class SkuItemVo {
    // 1.基础信息的获取
    SkuInfoEntity info;

    // 有货无货信息
    boolean hasStock = true;

    // 2.sku图片信息
    List<SkuImagesEntity> images;

    // 3.获取spu的销售属性组合
    List<SkuItemSaleAttrVo> saleAttr;

    // 4.获取spu介绍
    SpuInfoDescEntity desp;

    // 5.获取spu的规格参数信息
    List<SpuItemAttrGroupVo> groupAttrs;

    @Data
    public static class SkuItemSaleAttrVo{
        private Long attrId;
        private String attrName;
        private List<AttrValueWithSkuVo> attrValues;
    }

    @Data
    @ToString
    public static class SpuItemAttrGroupVo {
        private String groupName;
        private List<SpuBaseAttrVo> attrs;
    }

    @Data
    @ToString
    public static class SpuBaseAttrVo{
        private String attrName;
        private String attrValue;
    }
}
